#include "stm32_time.h"
#include "core_cm3.h"
#include "stm32f10x_error.h"

static u32 stm_TimeTick = 0;

void stm_delayUs(u32 time)
{
	u16 i = 0;
	
	while(time--){
		i = 10;
		while(i--);
	}

}
void stm_delayMs(u32 time)
{
	u16 i = 0;
	
	while(time--){
		i = 12000;
		while(i--);
	}

}


u32 stm_SysTick_Init(u32 ticks)
{
	if ( SysTick_Config(ticks) ){
		return STM32_FAIL;
	}

	return STM32_OK;
}


u32 stm_SysTick_Get(void)
{
	return stm_TimeTick;
}

void stm_SysTick_Inc(void)
{
	stm_TimeTick++;
}

void stm_SysTick_Reset(void)
{
   stm_TimeTick = 0;
}


